<template>
	<view class="container">
		<view class="category">
			<view @click="handleCategory(item.id)" class="category_item" v-for="(item, index) in categoryList" :key="item.id">
				<i :class='`iconfont ${item.icon}`' :style="`color: ${item.color}`"></i>
				<view>{{item.name}}</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		name:"category",
		props: {
			categoryList: {
				type: Array,
				default: []
			}
		},
		data() {
			return {
				
			};
		},
		methods: {
			handleCategory(id){
				// console.log(id);
				this.$emit('handleCategory', id)
			}
		}
	}
</script>

<style scoped>
.category{
	width: 100%;
	margin-top: 30rpx;
	display: flex;
	align-items: center;
	justify-content: space-between;
	box-sizing: border-box;
	padding: 0 30rpx;
}
.category_item{
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
}
.category_item i{
	font-size: 70rpx;
}
.category_item view{
	color: #808080;
	margin-top: 10rpx;
}
</style>
